//主数据表格配置
export const columns = [
  { title: '采购单号', dataIndex: 'purOrderNo', key: 'purOrderNo', align: 'center', scopedSlots: { customRender: 'column' } },
  { title: '采购单名称', dataIndex: 'purOrderName', key: 'purOrderName', align: 'center', },
  { title: '供应商', dataIndex: 'supplierName', key: 'supplierName', align: 'center', },
  { title: '采购类型', dataIndex: 'purType', key: 'purType', align: 'center' },
  // { title: '无税总价', dataIndex: 'totalIunitprice', key: 'totalIunitprice', align: 'center' },
  { title: '含税总价(元)', dataIndex: 'totalPrice', key: 'totalPrice', align: 'center', scopedSlots: { customRender: 'tofixed2' } },
  { title: '送货类型', dataIndex: 'deliveryType', key: 'deliveryType', align: 'center' },
  { title: '收货地址', dataIndex: 'deliveryAddr', key: 'deliveryAddr', align: 'center' },
  { title: '收货人', dataIndex: 'delivery', key: 'delivery', align: 'center' },
  { title: '收货人电话', dataIndex: 'deliveryTel', key: 'deliveryTel', align: 'center' },
  // { title: '收货人及电话', dataIndex: 'consignee', key: 'consignee', align: 'center' },
  // { title: '配送状态', dataIndex: 'deliveryState', key: 'deliveryState', align: 'center' },
  // { title: '开票状态', dataIndex: 'invoiceState', key: 'invoiceState', align: 'center' },
  { title: '订单状态', dataIndex: 'purOrderState', key: 'purOrderState', align: 'center', scopedSlots: { customRender: 'purOrderState' } },
  { title: '操作', dataIndex: 'action', key: 'operation', width: 180, align: 'center', scopedSlots: { customRender: 'action' } },
]
//主数据明细columns
export const columnsDetail = [
  { title: '编码', dataIndex: 'standardCode', key: 'standardCode', align: 'center' },
  { title: '品名', dataIndex: 'productNameZh', key: 'productNameZh', align: 'center', },
  { title: '供应商名称', dataIndex: 'supplierName', key: 'supplierName', align: 'center' },
  // { title: '通用名', dataIndex: 'tongYongm', key: 'tongYongm', align: 'center' },
  { title: '订单号', dataIndex: 'purOrderNo', key: 'purOrderNo', align: 'center', },
  { title: '生产企业名称', dataIndex: 'manufacturerZh', key: 'manufacturerZh', align: 'center', },
  { title: '规格', dataIndex: 'spec', key: 'spec', align: 'center' },
  { title: '型号', dataIndex: 'model', key: 'model', align: 'center' },
  { title: '计量单位', dataIndex: 'measurement', key: 'measurement', align: 'center' },
  { title: '单品含税价', dataIndex: 'iunitprice', key: 'iunitprice', align: 'center', scopedSlots: { customRender: 'tofixed2' } },
  { title: '采购数量', dataIndex: 'num', key: 'num', align: 'center', scopedSlots: { customRender: 'num' } },
  {
    title: '操作',
    dataIndex: 'action',
    width: 100,
    key: 'operation',
    align: 'center',
    scopedSlots: { customRender: 'action' },
  },
]

//主数据查询配置
export const q_formInfos = [
  { label: '采购单号', name: 'pid', type: 'purOrderSelect', placeholder: '采购单号' },
  { label: '采购类型', name: 'purType', type: 'dicselect', dicName: 'purType', placeholder: '采购类型' },
  { label: '状态', name: 'purOrderState', type: 'dicselect', dicName: 'purOrderState', placeholder: '状态' },
  { label: ['查询', '重置'], type: 'botton' }
]

export const q_formDatas = {
  pid: null,
  purType: null,
  purOrderState: null
}

//添加主数据表单配置
export const s_FormInfo = [
  { label: '采购类型', name: 'purType', type: 'dicselect', dicName: 'purType', placeholder: '请选择采购类型' },
  { label: '供应商', name: 'supplierOrgPid', type: 'supplier', placeholder: '请选择供应商' },
  // { label: '采购单号', name: 'purOrderNo', type: 'input', placeholder: '请输入采购单号' },
  // { label: '无税总价', name: 'totalIunitprice', type: 'input', placeholder: '请输入无税总价',scopedSlots: { customRender: 'tofixed2' }  },
  // { label: '含税总价', name: 'totalPrice', type: 'input', placeholder: '请输入含税总价',scopedSlots: { customRender: 'tofixed2' }  },
  { label: '送货类型', name: 'deliveryType', type: 'dicselect', dicName: 'deliveryType', placeholder: '请选择送货类型' },
  { label: '收货地址', name: 'deliveryAddr', type: 'deliveryAddressSelect', placeholder: '请选择地址' },
  // { label: '收货人及电话', name: 'consignee', type: 'input', placeholder: '请输入收货人及电话' },
  { label: '收货人', name: 'delivery', type: 'input', placeholder: '请输入收货人' },
  { label: '收货人电话', name: 'deliveryTel', type: 'input', placeholder: '请输入收货人电话' },
  { label: '结算方式', name: 'settlementType', type: 'dicselect', dicName: 'settlementType', placeholder: '请选择结算方式' },
  // { label: '配送状态', name: 'deliveryState', type: 'dicselect',dicName: 'deliveryState',  placeholder: '请选择配送状态' },
  // { label: '开票状态', name: 'invoiceState', type: 'dicselect',dicName: 'invoiceState',  placeholder: '请选择开票状态' },
  // { label: '订单状态', name: 'purOrderState', type: 'dicselect',dicName: 'purOrderState',  placeholder: '请选择订单状态' },
  { label: '采购单位备注', name: 'remarks', type: 'textarea', placeholder: '请输入采购单位备注' },
  { label: ['保存', '重置'], type: 'botton' },
]
export const s_formDatas = {
  sysSeq: 0,
  pid: '',
  purType: null,
  purOrderNo: null,
  supplierOrgPid: null,
  supplierName: null,
  totalIunitprice: null,
  totalPrice: null,
  deliveryType: null,
  deliveryAddr: null,
  delivery: null,
  deliveryTel: null,
  consignee: null,
  deliveryState: null,
  invoiceState: null,
  purOrderState: null,
  settlementType: null,
  remarks: null,
}
export const s_rules = {
  purType: [{ required: true, message: '采购类型必填', trigger: 'blur' }],
  supplierOrgPid: [{ required: true, message: '供应商必选', trigger: 'blur' }],
  deliveryAddr: [{ required: true, message: '收货地址必填', trigger: 'blur' }],
}

//查看明细显示配置
export const infoDatas = [
  { title: '采购单号', id: 'purOrderNo', value: '' },
  { title: '采购单名称', id: 'purOrderName', value: '' },
  { title: '采购类型', id: 'purType', value: '' },
  { title: '采购单位备注', id: 'remarks', value: '' },
  { title: '无税总价', id: 'totalIunitprice', value: '', style: 'fontWeight:bolder', toFixed2: true },
  { title: '含税总价', id: 'totalPrice', value: '', style: 'fontWeight:bolder', toFixed2: true },
  { title: '订单状态', id: 'purOrderState', value: '' },
  { title: '相关联订单号', id: 'relationPurOrderNo', value: '' },
  { title: '送货类型', id: 'deliveryType', value: '' },
  { title: '收货地址', id: 'deliveryAddr', value: '' },
  { title: '收货人', id: 'delivery', value: '' },
  { title: '收货人电话', id: 'deliveryTel', value: '' },
  // { title: '收货人及电话', id: 'consignee', value: '' },
  { title: '配送状态', id: 'deliveryState', value: '' },
  { title: '开票状态', id: 'invoiceState', value: '' },
  { title: '采购单生成时间', id: 'purOrderCreateTime', value: '' },
  { title: '采购单确认时间', id: 'purOrderCfmTime', value: '' },
  { title: '采购单完成时间', id: 'purOrderFinTime', value: '' },
]
